// Copyright 2013 Square, Inc.

package com.squareup.timessquare;

import java.util.Calendar;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.jiyici.R;
import com.squareup.timessquare.CalendarCellViewTemp.OnCellClickedListener;

public class CalendarCellViewLayout extends LinearLayout {
    
    private CalendarCellViewTemp cellView;
    private TextView countView;
    
    
    
    

  @SuppressWarnings("UnusedDeclaration")
  public CalendarCellViewLayout(Context context, AttributeSet attrs) {
    super(context, attrs);
    View view = inflate(context, R.layout.calendar_cell_view, this);
    cellView = (CalendarCellViewTemp) view.findViewById(R.id.date);
    countView = (TextView) view.findViewById(R.id.count);
  }
  
  @Override
public void setOnClickListener(OnClickListener l) {
      cellView.setOnClickListener(l);
}
  
  public void setOnCellClickedListener(OnCellClickedListener onCellClickedListener) {
      cellView.setOnCellClickedListener(onCellClickedListener);
    }
  
  public void setCalendar(Calendar calendar) {
      cellView.setCalendar(calendar);
  }
  
  public void setText(String date) {
      cellView.setText(date);
  }
  
  public void setTag(Object obj) {
      cellView.setTag(obj);
  }
  
  public void setCount(int count) {
      if (count == 0) {
          countView.setText("");
          return;
      }
      countView.setText("+" + count);
  }

  public void setSelectable(boolean isSelectable) {
    cellView.setSelectable(isSelectable);
  }

  public void setCurrentMonth(boolean isCurrentMonth) {
    cellView.setCurrentMonth(isCurrentMonth);
  }

  public void setToday(boolean isToday) {
    cellView.setToday(isToday);
  }

  public void setRangeState(MonthCellDescriptor.RangeState rangeState) {
    cellView.setRangeState(rangeState);
  }

  public void setHighlighted(boolean highlighted) {
      cellView.setHighlighted(highlighted);
  }

  
}
